package com.x.service.api;

import com.x.service.entity.AutoComplete;
import com.x.service.entity.Base;
import com.x.service.entity.BookDetail;
import com.x.service.entity.BookList;
import com.x.service.entity.CatsList;
import com.x.service.entity.ChapterList;
import com.x.service.entity.ChaptersInfo;
import com.x.service.entity.DeviceInfo;
import com.x.service.entity.HotWord;
import com.x.service.entity.RangeList;
import com.x.service.entity.TagList;
import com.x.service.entity.Version;
import com.x.zssqservice.bean.ChapterRead;

import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;

public interface BookApiService {

    @GET("/book/recommendList")
    Observable<BookList> getRecommendList(@Query("bookId") String bookId);

    @GET("/Book/detail")
    Observable<BookDetail> getBookDetial(@Query("bookId") String bookId);

    @GET("/Book/getListByTagId")
    Observable<BookList> getBooksByTag(@Query("tagId") String tag, @Query("start") int start, @Query("limit") int limit);

    @GET("/Book/getListByAuthor")
    Observable<BookList> getBooksByAuthor(@Query("author") String author, @Query("start") int start, @Query("limit") int limit);

    @GET("/Book/search")
    Observable<BookList> searchBook(@Query("query") String query, @Query("start") int start, @Query("limit") int limit);

    @GET("/Book/autoComplete")
    Observable<AutoComplete> autoComplete(@Query("query") String query);

    @GET("/Book/hotWords")
    Observable<HotWord> getHotWord();

    @GET("/Book/getChapterListByBookId")
    Observable<ChaptersInfo> getChapters(@Query("bookId") String bookId);

    @GET("/Book/getTags")
    Observable<TagList> getTagLst();

    @GET("/Book/getCats/")
    Observable<CatsList> getCatList();

    @GET("/Book/getListByCatId")
    Observable<BookList> getBookByCat(@Query("cat") String cat, @Query("start") int start, @Query("limit") int limit);

    @GET("/Book/getRankList")
    Observable<RangeList> getRangelist();

    @GET("/Book/getListByRankId")
    Observable<BookList> getBooksByRangeId(@Query("rankingId") String id);

    @POST("/Service/reportDevice")
    Observable<Base> reportDerice(@Body DeviceInfo deviceInfo);

    @GET("/Service/getAppVersion")
    Observable<Version> getVersion(@Query("channelId") String channelId);

    @GET("/User/addToLib")
    Observable<Base> addToLib(@Query("token") String token, @Query("bookId") String book);

    @GET("/Book/getListByIds")
    Observable<BookList> getBooksByIds(@Query("bookIds") String bookIds);

    @GET("Book/chapter/")
    Observable<ChapterRead> getChapterRead(@Query("url") String url);
}